﻿using System;

namespace Outfish {

	internal class ContainsTextSelector : INodeSelector {
	
		#region constructor
	
		public ContainsTextSelector( string subtext ){
			this._subtext = subtext;
		}
		
		#endregion
		
		public bool IsMatch(HtmlNode node) { 
			return node.OuterHtml.Contains( this._subtext ); 
		}
	
		public override string ToString() {	return ":contains('" + this._subtext + "')"; }
	
		#region private field
		
		string _subtext;
		
		#endregion
		
	}
	
}
